gtk4.git
5 years agogdk: Conflate GDK devices
Carlos Garnacho [Tue, 28 Jul 2020 22:03:48 +0000 (00:03 +0200)]
gdk: Conflate GDK devices

Make GdkEvents hold a single GdkDevice. This device is closer to
the logical device conceptually, although it must be sufficient for
device checks (i.e. GdkInputSource), which makes it similar to the
physical devices.

Make the logical devices have a more accurate GdkInputSource where
needed, and conflate the event devices altogether.

5 years agogdk: Drop source_device argument from _gdk_display_device_grab_update()
Carlos Garnacho [Tue, 28 Jul 2020 21:00:02 +0000 (23:00 +0200)]
gdk: Drop source_device argument from _gdk_display_device_grab_update()

It's just passed around and used nowhere.

5 years agogdk: Make events hold an axis array matching GdkAxisUse
Carlos Garnacho [Tue, 28 Jul 2020 17:38:24 +0000 (19:38 +0200)]
gdk: Make events hold an axis array matching GdkAxisUse

Instead of doing device-specific translations of array positions,
use GdkAxisUse as an array index right away.

5 years agogdk: Make GdkDevice axis API internal
Carlos Garnacho [Tue, 28 Jul 2020 14:21:47 +0000 (16:21 +0200)]
gdk: Make GdkDevice axis API internal

All outside interaction happens through gdk_event_get_axis(), no
device poking is necessary, nor axis to array index translations.

5 years agogdk: Remove gdk_device_get_axes()
Carlos Garnacho [Tue, 28 Jul 2020 15:10:45 +0000 (17:10 +0200)]
gdk: Remove gdk_device_get_axes()

Besides the implicit x/y assumptions, devices don't have axes. Those
are actually provided by the GdkDeviceTool driving the device, and
different tools may have different axes.

It does not make sense to offer this API that can change beneath
someone's feet, we now have gdk_device_tool_get_axes() which is static
to the tool.

5 years agoinspector: Show tool axes, instead of device axes
Carlos Garnacho [Tue, 28 Jul 2020 15:07:48 +0000 (17:07 +0200)]
inspector: Show tool axes, instead of device axes

We are moving away from the latter as they are inconsistent with
Wayland. Make the inspector introspect known tools and their info,
instead.

5 years agogdk: Add gdk_seat_get_tools() API call
Carlos Garnacho [Tue, 28 Jul 2020 14:51:41 +0000 (16:51 +0200)]
gdk: Add gdk_seat_get_tools() API call

There's GdkSeat::tool-added and ::tool-removed, but there's no
API to query the known tools. Add this call.

5 years agogdk: Add gdk_device_tool_get_axes()
Carlos Garnacho [Tue, 28 Jul 2020 14:31:54 +0000 (16:31 +0200)]
gdk: Add gdk_device_tool_get_axes()

Axes are actually a per-tool property, we just adapt devices to the
current tool.

5 years agodocs: Correct migration note
Carlos Garnacho [Tue, 28 Jul 2020 14:00:02 +0000 (16:00 +0200)]
docs: Correct migration note

A mentioned API call is now internal.

5 years agogdkdevice: Remove gdk_device_get_state()
Carlos Garnacho [Tue, 28 Jul 2020 13:50:15 +0000 (15:50 +0200)]
gdkdevice: Remove gdk_device_get_state()

This is not needed nor recommended anymore, all reasons to maybe
need this were all kept within gdk.

5 years agogtkwindow: Move away from gdk_device_get_state()
Carlos Garnacho [Tue, 28 Jul 2020 13:46:05 +0000 (15:46 +0200)]
gtkwindow: Move away from gdk_device_get_state()

Use gdk_device_get_modifier_state() poking the keyboard and keymap,
instead of this function.

5 years agogtkpopover: Move away from gdk_device_get_state()
Carlos Garnacho [Tue, 28 Jul 2020 13:44:09 +0000 (15:44 +0200)]
gtkpopover: Move away from gdk_device_get_state()

Use gdk_device_get_modifier_state() poking the keyboard and keymap,
instead of this function.

5 years agogdk: Drop GDK_SOURCE_CURSOR
Carlos Garnacho [Tue, 28 Jul 2020 13:25:28 +0000 (15:25 +0200)]
gdk: Drop GDK_SOURCE_CURSOR

Looking at the xf86-input-wacom driver code, this is not even a thing
anymore. Drop this device type, in modern days there's
GDK_DEVICE_TOOL_TYPE_MOUSE for this.

5 years agoMerge branch 'wip/chergert/fix-macos-time-conversion' into 'master'
Matthias Clasen [Mon, 27 Jul 2020 20:51:17 +0000 (20:51 +0000)]
Merge branch 'wip/chergert/fix-macos-time-conversion' into 'master'

macos: support ARM/PowerPC time conversion for DisplayLink times

See merge request GNOME/gtk!2301

5 years agomacos: support ARM/PowerPC time conversion for DisplayLink times
Christian Hergert [Mon, 27 Jul 2020 19:49:57 +0000 (12:49 -0700)]
macos: support ARM/PowerPC time conversion for DisplayLink times

When converting DisplayLink frame presentation times, we need to take into
account the arch-specific types. This tracks changes in GNOME/GLib!1566 so
that precision is not lost.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Mon, 27 Jul 2020 18:50:45 +0000 (18:50 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2300

5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Mon, 27 Jul 2020 17:45:19 +0000 (17:45 +0000)]
Update Ukrainian translation

5 years agogtk-demo: Simplify colors demo
Matthias Clasen [Mon, 27 Jul 2020 17:21:59 +0000 (13:21 -0400)]
gtk-demo: Simplify colors demo

Make best use of our new constructors.

5 years agoNEWS: Tweak the wording
Matthias Clasen [Mon, 27 Jul 2020 16:39:43 +0000 (12:39 -0400)]
NEWS: Tweak the wording

5 years agoMerge branch 'a11y-docs' into 'master'
Matthias Clasen [Mon, 27 Jul 2020 15:45:51 +0000 (15:45 +0000)]
Merge branch 'a11y-docs' into 'master'

a11y: Document roles of widgets

See merge request GNOME/gtk!2299

5 years agodocs: Flesh out the role table in the a11y intro
Matthias Clasen [Mon, 27 Jul 2020 15:10:58 +0000 (11:10 -0400)]
docs: Flesh out the role table in the a11y intro

Add cross-references for all the widgets currently
implementing non-default roles.

5 years agoa11y: Document roles of widgets
Matthias Clasen [Mon, 27 Jul 2020 14:46:52 +0000 (10:46 -0400)]
a11y: Document roles of widgets

Add a section to the long description for each
widget that is using a non-default accessible role.

5 years agoUpdate POTFILES.in and POTFILES.skip
Piotr Drąg [Mon, 27 Jul 2020 14:45:40 +0000 (16:45 +0200)]
Update POTFILES.in and POTFILES.skip

5 years agoMerge branch 'ebassi/a11y-fixes' into 'master'
Matthias Clasen [Mon, 27 Jul 2020 14:27:07 +0000 (14:27 +0000)]
Merge branch 'ebassi/a11y-fixes' into 'master'

Ebassi/a11y fixes

Closes #2955

See merge request GNOME/gtk!2298

5 years agoa11y: Test unset relations
Emmanuele Bassi [Mon, 27 Jul 2020 12:58:11 +0000 (13:58 +0100)]
a11y: Test unset relations

We use "NULL" in C to mean "undefined", when it comes to relations that
deal with references or reference lists.

5 years agoa11y: Allow unsetting the relations using NULL
Emmanuele Bassi [Mon, 27 Jul 2020 12:53:05 +0000 (13:53 +0100)]
a11y: Allow unsetting the relations using NULL

Accessible values storing references and reference lists can be unset by
using NULL to mean "undefined"; since we cannot return the NULL value,
we need to intercept it when collecting a value, and replace it with an
undefined GtkAccessibleValue, which is also the value used as the
default for GtkAccessibleRelation values that store a reference or a
reference list.

Fixes: #2955
5 years agodocs: Document a11y attributes
Emmanuele Bassi [Mon, 27 Jul 2020 12:50:01 +0000 (13:50 +0100)]
docs: Document a11y attributes

5 years agoNEWS: Updates
Matthias Clasen [Mon, 27 Jul 2020 12:36:54 +0000 (08:36 -0400)]
NEWS: Updates

5 years agoMerge branch 'ebassi/ci-dags' into 'master'
Emmanuele Bassi [Mon, 27 Jul 2020 12:06:59 +0000 (12:06 +0000)]
Merge branch 'ebassi/ci-dags' into 'master'

ci: Use DAG attributes

See merge request GNOME/gtk!2297

5 years agoMerge branch 'ebassi/new-a11y' into 'master'
Matthias Clasen [Mon, 27 Jul 2020 11:55:19 +0000 (11:55 +0000)]
Merge branch 'ebassi/new-a11y' into 'master'

Accessibility rework

See merge request GNOME/gtk!2239

5 years agoci: Use DAG attributes
Emmanuele Bassi [Mon, 27 Jul 2020 11:44:36 +0000 (12:44 +0100)]
ci: Use DAG attributes

Some jobs can run out of order, as they are entirely self-contained. If
we use the newly added DAG attributes, we can speed up the CI pipeline.

5 years agoa11y: Make GtkATContext.create() public
Emmanuele Bassi [Mon, 27 Jul 2020 10:46:52 +0000 (11:46 +0100)]
a11y: Make GtkATContext.create() public

Implementations of the GtkAccessible interface should have a way to
instantiate the appropriate GtkATContext.

5 years agodocs: Add missing GTK_ACCESSIBLE_VALUE_UNDEFINED
Emmanuele Bassi [Mon, 27 Jul 2020 10:46:07 +0000 (11:46 +0100)]
docs: Add missing GTK_ACCESSIBLE_VALUE_UNDEFINED

5 years agoa11y: Add some more tests
Matthias Clasen [Mon, 27 Jul 2020 05:21:05 +0000 (01:21 -0400)]
a11y: Add some more tests

Test that setting multiple states or properties
at the same time works as expected.

5 years agoAdd some more a11y tests
Matthias Clasen [Mon, 27 Jul 2020 04:22:15 +0000 (00:22 -0400)]
Add some more a11y tests

Add some tests that exercise the accessible machinery
without any connection to widgets.

5 years agoa11y: Be a bit safer against crashes
Matthias Clasen [Mon, 27 Jul 2020 04:21:01 +0000 (00:21 -0400)]
a11y: Be a bit safer against crashes

We are collecting values from varargs and use them
as indices into static arrays. We should at least
do some bounds checking to prevent silly crashes.

5 years agodocs: Expand GtkAccessible documentation
Matthias Clasen [Mon, 27 Jul 2020 02:39:17 +0000 (22:39 -0400)]
docs: Expand GtkAccessible documentation

Add some hints and examples.

5 years agodocs: Add documentation for accessible enumerations
Matthias Clasen [Mon, 27 Jul 2020 02:13:41 +0000 (22:13 -0400)]
docs: Add documentation for accessible enumerations

This is largely taking text from the aria spec.

5 years agodocs: Update GtkAccessibleRole docs
Matthias Clasen [Mon, 27 Jul 2020 01:18:50 +0000 (21:18 -0400)]
docs: Update GtkAccessibleRole docs

Sync up the docs with changed enum values, and document
all the roles that are used in GTK at the moment. All
others are left as "Unused".

5 years agodocs: Fix up some issues in the a11y docs
Matthias Clasen [Mon, 27 Jul 2020 00:54:57 +0000 (20:54 -0400)]
docs: Fix up some issues in the a11y docs

Fix up syntax errors and links in the introductory
section about accessibility.

5 years agodocs: Update a11y docs
Matthias Clasen [Mon, 27 Jul 2020 00:30:36 +0000 (20:30 -0400)]
docs: Update a11y docs

Add some missing functions.

5 years agoMerge branch 'drop-down-constructor' into 'master'
Matthias Clasen [Sun, 26 Jul 2020 23:57:48 +0000 (23:57 +0000)]
Merge branch 'drop-down-constructor' into 'master'

GtkDropDown api revisions

See merge request GNOME/gtk!2286

5 years agoMerge branch 'list-constructors' into 'master'
Matthias Clasen [Sun, 26 Jul 2020 23:56:21 +0000 (23:56 +0000)]
Merge branch 'list-constructors' into 'master'

List constructors

See merge request GNOME/gtk!2296

5 years agogridview: Revise constructors
Matthias Clasen [Sun, 26 Jul 2020 22:50:50 +0000 (18:50 -0400)]
gridview: Revise constructors

Make both gtk_grid_view_new and gtk_grid_view_new_with_factory
take a model as first argument, and make all arguments
allow-none and transfer full.

Update all callers.

5 years agocolumnview: Revise the constructor
Matthias Clasen [Sun, 26 Jul 2020 22:32:50 +0000 (18:32 -0400)]
columnview: Revise the constructor

Make gtk_column_view_new take a model as first argument,
and make it allow-none and transfer full.

Update all callers.

5 years agolistview: Revise constructors
Matthias Clasen [Sun, 26 Jul 2020 22:27:23 +0000 (18:27 -0400)]
listview: Revise constructors

Make both gtk_list_view_new and gtk_list_view_new_with_factory
take a model as first argument, and make all arguments
allow-none and transfer full.

Update all callers.

5 years agodropdown: Revise constructors
Matthias Clasen [Sun, 26 Jul 2020 13:34:08 +0000 (09:34 -0400)]
dropdown: Revise constructors

A dropdown without a model is useless, so accept a model
and expression in the constructor. Allow them to be NULL,
but consume them if given. This makes chained constructors
convenient without breaking language bindings.

Drop gtk_drop_down_set_from_strings() and instead add
gtk_drop_down_new_from_strings().

Update all users.

5 years agoselectionfiltermodel: Make constructor allow-none
Matthias Clasen [Sun, 26 Jul 2020 21:34:44 +0000 (17:34 -0400)]
selectionfiltermodel: Make constructor allow-none

We don't pay attention to item-type anymore, so
drop the item-type property and the _for_item_type()
constructor, and allow passing NULL to the regular
constructor.

We don't make this constructor transfer-full, since
the selection filter model is not a wrapping model
like the others. It is more like fork than a wrap.

5 years agomultiselection: Make constructor transfer full
Matthias Clasen [Sun, 26 Jul 2020 21:25:06 +0000 (17:25 -0400)]
multiselection: Make constructor transfer full

This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Also make the constructor return GtkMultiSelection *.

Update all callers.

5 years agosingleselection: Make constructor transfer full
Matthias Clasen [Sun, 26 Jul 2020 21:16:15 +0000 (17:16 -0400)]
singleselection: Make constructor transfer full

This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.

5 years agonoselection: Make constructor transfer full
Matthias Clasen [Sun, 26 Jul 2020 20:55:43 +0000 (16:55 -0400)]
noselection: Make constructor transfer full

This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.

5 years agotreelistmodel: Make constructor transfer full
Matthias Clasen [Sun, 26 Jul 2020 20:38:53 +0000 (16:38 -0400)]
treelistmodel: Make constructor transfer full

Make gtk_tree_list_model_new() take the root model
as first argument, and make it transfer full, for
consistency with other wrapping list constructors.

Update all callers.

Still missing here: Make the model property writable,
and allow passing NULL in the constructor.

5 years agosortlistmodel: Make constructor transfer full
Matthias Clasen [Sun, 26 Jul 2020 20:25:12 +0000 (16:25 -0400)]
sortlistmodel: Make constructor transfer full

This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.

5 years agofilterlistmodel: Make constructor transfer full
Matthias Clasen [Sun, 26 Jul 2020 19:55:44 +0000 (15:55 -0400)]
filterlistmodel: Make constructor transfer full

This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.

5 years agoslicelistmodel: Make constructor transfer full
Matthias Clasen [Sun, 26 Jul 2020 19:38:15 +0000 (15:38 -0400)]
slicelistmodel: Make constructor transfer full

This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.

5 years agolistlistmodel: Drop item_type
Matthias Clasen [Sun, 26 Jul 2020 18:37:55 +0000 (14:37 -0400)]
listlistmodel: Drop item_type

We are using G_TYPE_OBJECT throughout, so there
is no need for GtkListListModel to do anything else.

Update all callers.

5 years agomaplistmodel: Make constructor transfer full
Matthias Clasen [Sun, 26 Jul 2020 18:20:25 +0000 (14:20 -0400)]
maplistmodel: Make constructor transfer full

This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.

5 years agoflattenlistmodel: Make the constructor transfer full
Matthias Clasen [Sun, 26 Jul 2020 14:53:55 +0000 (10:53 -0400)]
flattenlistmodel: Make the constructor transfer full

This is for consistency with other wrapping list constructors.
We want them all to be transfer full, allow-none.

Update all callers.

5 years agoci: Re-enable the accessibility test suite
Emmanuele Bassi [Sun, 26 Jul 2020 19:56:54 +0000 (20:56 +0100)]
ci: Re-enable the accessibility test suite

Now that we have something that is both reliable and local.

5 years agoa11y: Add a simple test case for GtkButton's accessible state
Emmanuele Bassi [Sun, 26 Jul 2020 19:30:35 +0000 (20:30 +0100)]
a11y: Add a simple test case for GtkButton's accessible state

5 years agoa11y: Simplify the test API
Emmanuele Bassi [Sun, 26 Jul 2020 19:29:00 +0000 (20:29 +0100)]
a11y: Simplify the test API

We don't need as many functions to print out the property, relation, and
state of an accessible. Additionally, we should allow comparing the
accessible attributes with an expected value, and print out the real
accessible value if they do not match.

5 years agoa11y: Allow setting the role post-construction
Emmanuele Bassi [Sun, 26 Jul 2020 19:27:39 +0000 (20:27 +0100)]
a11y: Allow setting the role post-construction

Some widgets have different roles after they are constructed, so we need
to allow changing the role defined by the class. We should still avoid
setting a role after the GtkATContext has been created.

5 years agoa11y: Add API to retrieve accessible values
Emmanuele Bassi [Sun, 26 Jul 2020 14:50:55 +0000 (15:50 +0100)]
a11y: Add API to retrieve accessible values

We are going to use this for implementing ATContext subclasses, but also
in the testing API.

5 years agoa11y: Add more test API
Emmanuele Bassi [Wed, 22 Jul 2020 15:32:09 +0000 (16:32 +0100)]
a11y: Add more test API

5 years agoa11y: Restart the accessibility test suite
Emmanuele Bassi [Wed, 22 Jul 2020 15:31:44 +0000 (16:31 +0100)]
a11y: Restart the accessibility test suite

5 years agoFix build with debugging notes disabled
Emmanuele Bassi [Wed, 22 Jul 2020 12:48:00 +0000 (13:48 +0100)]
Fix build with debugging notes disabled

5 years agoa11y: Update GtkCheckButton
Matthias Clasen [Fri, 17 Jul 2020 19:51:28 +0000 (15:51 -0400)]
a11y: Update GtkCheckButton

This is a bit unfortunate, since the aria modelling
doesn't quite agree with ours, so we have to listen
for the togglebutton property change, and we inherit
the pressed state from the togglebutton accessible.

5 years agoa11y: Update GtkSpinButton
Matthias Clasen [Fri, 17 Jul 2020 18:41:06 +0000 (14:41 -0400)]
a11y: Update GtkSpinButton

Set the appropriate accessible role, and update
the value properties.

5 years agoa11y: Update GtkProgressBar
Matthias Clasen [Fri, 17 Jul 2020 17:10:18 +0000 (13:10 -0400)]
a11y: Update GtkProgressBar

Update state and properties as appropriate.

5 years agotestatcontext: Print role nicks
Matthias Clasen [Fri, 17 Jul 2020 16:42:24 +0000 (12:42 -0400)]
testatcontext: Print role nicks

This makes for easier reading.

5 years agoa11y: Update labelled-by when setting mnemonic labels
Emmanuele Bassi [Wed, 22 Jul 2020 12:11:28 +0000 (13:11 +0100)]
a11y: Update labelled-by when setting mnemonic labels

The ARIA labelled-by attribute behaves the same way as the mnemonic
labels in GTK.

5 years agoa11y: Change the collection type for reflist attributes
Emmanuele Bassi [Wed, 22 Jul 2020 12:08:20 +0000 (13:08 +0100)]
a11y: Change the collection type for reflist attributes

5 years agoa11y: Allow storing list of references in GtkAccessibleValue
Emmanuele Bassi [Wed, 22 Jul 2020 12:07:36 +0000 (13:07 +0100)]
a11y: Allow storing list of references in GtkAccessibleValue

It's one of the fundamental accessible value types in ARIA.

5 years agoa11y: Change default accessible role
Emmanuele Bassi [Fri, 17 Jul 2020 16:43:01 +0000 (17:43 +0100)]
a11y: Change default accessible role

Only GtkWidget should use GTK_ACCESSIBLE_ROLE_WIDGET as its default
accessible role; the default for GtkAccessible and GtkATContext should
be GTK_ACCESSIBLE_ROLE_NONE, meaning "an element whose implicit native
role semantics will not be mapped to the accessibility API", according
to the WAI-ARIA specification.

5 years agoinspector: Support the a11y debug flag
Matthias Clasen [Fri, 17 Jul 2020 14:40:31 +0000 (10:40 -0400)]
inspector: Support the a11y debug flag

Add support for the GTK_DEBUG_A11Y debug flag in
the logs tab.

5 years agotestatcontext: Use the new debug flag
Matthias Clasen [Fri, 17 Jul 2020 14:36:43 +0000 (10:36 -0400)]
testatcontext: Use the new debug flag

Only dump a11y state if GTK_DEBUG=accessibility is set.

5 years agoAdd GTK_DEBUG=accessibility
Matthias Clasen [Fri, 17 Jul 2020 14:36:20 +0000 (10:36 -0400)]
Add GTK_DEBUG=accessibility

Add a debug flag for accessibility-related debug spew.

5 years agoa11y: Add testing API
Emmanuele Bassi [Fri, 17 Jul 2020 13:39:56 +0000 (14:39 +0100)]
a11y: Add testing API

We want to test the accessibility API, as well as the implementation
inside each widget. For that, we should expose an API that lets us
verify that a GtkAccessible has a given role, as well as a given
property.

The API follows the pattern of other GTest API:

 - a macro to assert that a condition is respected
 - a function that prints out the error message in case of failure

5 years agoa11y: Implement role and state change in GtkSwitch
Emmanuele Bassi [Fri, 17 Jul 2020 13:31:02 +0000 (14:31 +0100)]
a11y: Implement role and state change in GtkSwitch

Set the "switch" role, and update the "checked" state when the :active
property is toggled.

5 years agoa11y: Consolidate the attributes container
Emmanuele Bassi [Fri, 17 Jul 2020 11:49:59 +0000 (12:49 +0100)]
a11y: Consolidate the attributes container

While we have split the various attributes for convenience, there's no
reason why we should have specialised data types for the attributes
container object.

5 years agoa11y: Add relations API
Emmanuele Bassi [Fri, 17 Jul 2020 11:00:31 +0000 (12:00 +0100)]
a11y: Add relations API

Since we split relation attributes from the generic properties, we need
to add API for setting and retrieving their values.

5 years agoa11y: Simplify GtkAccessibleValue
Emmanuele Bassi [Thu, 16 Jul 2020 17:08:22 +0000 (18:08 +0100)]
a11y: Simplify GtkAccessibleValue

Reduce the amount of subclassing, by handling collection of fundamental
types directly from the generic code paths. We now handle boolean,
tristate, integer, number, string, and relation values in the generic
code path; if an attribute supports the "undefined" value, we return the
undefined value singleton.

5 years agoa11y: Resync with the ARIA spec
Emmanuele Bassi [Wed, 15 Jul 2020 18:08:37 +0000 (19:08 +0100)]
a11y: Resync with the ARIA spec

Drop roles and properties that were deprecated in WAI-ARIA 1.1, and add
new roles and properties defined in WAI-ARIA 1.2 and later.

We also split the relationship properties into their own enumeration, so
we can keep the GtkAccessibleProperty type more compact.

5 years agoRemove GTK_ACCESSIBLE_STATE_NONE
Emmanuele Bassi [Wed, 15 Jul 2020 12:20:38 +0000 (13:20 +0100)]
Remove GTK_ACCESSIBLE_STATE_NONE

It's pointless, we can use an explicit value of `-1` everywhere.
Additionally, it complicates all code that uses the state enumeration as
an array index, since now we need to guard against a negative offset.

5 years agoa11y: Add binding-friendly accessible property setter
Emmanuele Bassi [Mon, 13 Jul 2020 16:47:36 +0000 (17:47 +0100)]
a11y: Add binding-friendly accessible property setter

Matching the one for the accessible state.

5 years agoa11y: Collect reference value
Emmanuele Bassi [Mon, 13 Jul 2020 16:43:06 +0000 (17:43 +0100)]
a11y: Collect reference value

Some properties that take a reference to an accessible haven't been
updated to collect the correct type.

5 years agoa11y: Update the accessible label for GtkButton
Emmanuele Bassi [Mon, 13 Jul 2020 16:04:38 +0000 (17:04 +0100)]
a11y: Update the accessible label for GtkButton

5 years agoa11y: Update GtkSeparator
Emmanuele Bassi [Mon, 13 Jul 2020 15:26:24 +0000 (16:26 +0100)]
a11y: Update GtkSeparator

Add an accessible role, and update the orientation state.

5 years agoa11y: Set the role for GtkScale
Emmanuele Bassi [Mon, 13 Jul 2020 15:22:44 +0000 (16:22 +0100)]
a11y: Set the role for GtkScale

5 years agoa11y: Update the accessible state for GtkRange
Emmanuele Bassi [Mon, 13 Jul 2020 15:22:22 +0000 (16:22 +0100)]
a11y: Update the accessible state for GtkRange

5 years agoa11y: Update the "pressed" state on toggle buttons
Emmanuele Bassi [Mon, 13 Jul 2020 15:10:36 +0000 (16:10 +0100)]
a11y: Update the "pressed" state on toggle buttons

5 years agoa11y: Add roles to various widgets
Emmanuele Bassi [Mon, 13 Jul 2020 15:03:27 +0000 (16:03 +0100)]
a11y: Add roles to various widgets

5 years agoAdd accessible properties to GtkAccessible
Emmanuele Bassi [Mon, 13 Jul 2020 14:51:39 +0000 (15:51 +0100)]
Add accessible properties to GtkAccessible

We propagate the accessible state and properties to each ATContext in
the same virtual function, since they are functionally similar.

5 years agoAdd GtkAccessiblePropertySet
Emmanuele Bassi [Sun, 12 Jul 2020 19:07:57 +0000 (20:07 +0100)]
Add GtkAccessiblePropertySet

Like GtkAccessibleStateSet, the PropertySet is a set for accessible
properties.

5 years agoPlumb all the GtkAccessibleProperty values into GtkAccessibleValue
Emmanuele Bassi [Mon, 13 Jul 2020 14:22:24 +0000 (15:22 +0100)]
Plumb all the GtkAccessibleProperty values into GtkAccessibleValue

Similarly to how we deal with GtkAccessibleState.

5 years agoAllow setting the accessible role at construction
Emmanuele Bassi [Mon, 13 Jul 2020 14:20:19 +0000 (15:20 +0100)]
Allow setting the accessible role at construction

Some widgets have different accessible roles depending on some
parameter, so we cannot set the role at class init time. For those
widgets, we add an "accessible-role" property to GtkAccessible, and we
allow setting it (only) at construction time.

5 years agoStart documenting the Accessibility API
Emmanuele Bassi [Wed, 8 Jul 2020 13:42:32 +0000 (14:42 +0100)]
Start documenting the Accessibility API

Add the introductory text from #2833, and the various types to the API
reference.

5 years agoUpdate the accessible state on widget visibility changes
Emmanuele Bassi [Tue, 7 Jul 2020 16:51:01 +0000 (17:51 +0100)]
Update the accessible state on widget visibility changes

The GTK_ACCESSIBLE_STATE_HIDDEN has the opposite meaning of the
GtkWidget:visible property.

5 years agoHave GtkWidget implement GtkAccessible
Emmanuele Bassi [Wed, 8 Jul 2020 15:58:11 +0000 (16:58 +0100)]
Have GtkWidget implement GtkAccessible

Each widget type has an accessible role associated to its class, as
roles cannot change during the life time of a widget instance.

Each widget is also responsible for creating an ATContext, to proxy
state changes to the underlying accessibility infrastructure.

5 years agoPlug GtkATContext into GtkAccessible
Emmanuele Bassi [Wed, 8 Jul 2020 15:56:31 +0000 (16:56 +0100)]
Plug GtkATContext into GtkAccessible

An Accessible implementation must create an ATContext object. UI
elements are supposed to interact with the GtkAccessible API, but we
expose GtkATContext to allow patterns like delegation.